package com.ibm.risk.irmp.base.auth.rest;

import com.ibm.risk.irmp.base.auth.service.IOrgUserBaseService;
import com.ibm.risk.irmp.common.auth.vo.IUserInfoVo;
import com.ibm.risk.irmp.common.auth.vo.OrgInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v2/auth/org-user")
public class OrgUserBaserController implements IOrgUserBaseService {


    @Autowired IOrgUserBaseService orgUserBaseService;
    @Override
    @GetMapping("/biz-branches/{branchCode}")
    public OrgInfoVo getBizOrgInfo(@PathVariable String branchCode) {
        return orgUserBaseService.getBizOrgInfo(branchCode);
    }

    @Override
    @GetMapping("/mng-branches/{branchCode}")
    public OrgInfoVo getMngOrgInfo(@PathVariable String branchCode) {
        return orgUserBaseService.getMngOrgInfo(branchCode);
    }

    @Override
    @GetMapping("/user-infos/sn/{userSn}")
    public IUserInfoVo getUserInfoBySn(@PathVariable String userSn) {
        return orgUserBaseService.getUserInfoBySn(userSn);
    }

    @Override
    @GetMapping("/user-infos/{username}")
    public IUserInfoVo getUserInfoByUserName(@PathVariable String username) {

        return orgUserBaseService.getUserInfoByUserName(username);

    }
}
